<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件复习</title>
</head>
<body>
    <input type="text" class="inp1"><br>
    <input type="text" class="inp2"><br>
    <input type="text" class="inp3"><br>
    <input type="text" class="inp4"><br>
    <script>
        // onfocus 获取焦点触发
        document.querySelector('.inp1').onfocus=function(){
            console.log('获取焦点时，触发！')
        };
        
        document.querySelector('.inp2').onblur=function(){
            console.log('失去焦点时触发！')
        };

        document.querySelector('.inp3').oninput=function(){
            console.log('选中元素内容发生改变时触发！')
        };

        document.querySelector('.inp4').onchange=function(){
            console.log('选中元素内容发生改变，且失去焦点后触发！！')
        };
    </script>
</body>
</html>